function validate(){
	
	var regno = document.getElementById('txtRegno');
	var subgr = document.getElementById('sltSubgr');
	var date = document.getElementById('txtDy');
	
	
	if(notEmpty(regno, "Registration Number cannot be empty")){
	   if(isNumeric(regno, "Registration Number should be numeric ")){
	        if(madeSelection(subgr, "Select the subject code")){
	              if(madeSelection(date, "Select the date")){
	
	                                     loadXMLDoc()
	
											}
								return false;
							}
	     				return false;
		 			}	 
	    		return false;
				}
		return false;
		}
	
	
function loadXMLDoc()
{
	if (window.XMLHttpRequest)
  		{// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  		}
	else
  		{// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  		}
xmlhttp.onreadystatechange=function()
  {
  	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
		    document.getElementById("ajaxDiv").innerHTML=xmlhttp.responseText;
	
	    }
  }                 
                
				var id = document.getElementById('id').value;
                var regno = document.getElementById('txtRegno').value;	
                var date = document.getElementById('txtDy').value;	
               	var subgr = document.getElementById('sltSubgr').value;
	
	
	var queryString ="?regno=" + regno +"&date="+date+ "&subgr=" + subgr+ "&id=" + id ;
	
	xmlhttp.open("GET","../logic/update/att_student_update.php"+queryString ,true);
	xmlhttp.send();
}


function backxx()
{
	var startrow=document.getElementById('startrow').value;
	var tag=document.getElementById('tag').value;
	if(tag ==1)
		{
			document.location="../admin/admin_home.php?tab=att_student_search&page="+startrow;
		}
	else 
		{
			document.location="att_student_searchx.php?page="+startrow;
		}
}
	
	
function checkregno()
	{
	var regno = document.getElementById('txtRegno');
	if(notEmpty(regno, "Registration Number cannot be empty"))
		{
 			if (window.XMLHttpRequest)
  				{// code for IE7+, Firefox, Chrome, Opera, Safari
   				xmlhttp=new XMLHttpRequest();
    			}
 			else
   				{// code for IE6, IE5
				 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     			}
    	xmlhttp.onreadystatechange=function()
     			{
 					if (xmlhttp.readyState==4 && xmlhttp.status==200)
  							{
							 var x=xmlhttp.responseText;
							 if(x=="false")
									{
								  	document.getElementById("ajaxDiv1").innerHTML="Invalid Registration No";
  									document.getElementById('txtRegno').value="";
									}
							 else
							 		{
  									document.getElementById("ajaxDiv1").innerHTML=x; 
									}
					}
            	}
								
 	var y=document.getElementById('txtRegno').value;
 	var queryString ="?regno=" + y;
 	xmlhttp.open("GET","../logic/load/check_reg.php"+queryString,true);
 	xmlhttp.send();	  
	}
}




